import request from '@/utils/request'

export default {
    //1 讲师列表（条件查询带分页）
    //currentd当前页, limit每页记录数 teacherQuery条件对象
    getTeacherListPage(current, limit, teacherQuery) {
        return request({
            // url: '/eduservice/teacher/pageTeacherCondition/'+current+"/"+limit,
            //后台接口位置COntroller
            url: `/eduservice/teacher/pageTeacherCondition/${current}/${limit}`,
            method: 'post',
            //teacherQuery条件对象，后端使用RequestBody获取数据
            //data表示把该对象变成Json传到接口里面
            data: teacherQuery
        })
    },
    deleteTeacherById(id) {
        return request({
            //后台接口位置COntroller
            url: `/eduservice/teacher/${id}`,
            method: 'delete'
        })
    },
    //saveTheacherInfon添加教师信息
    addTeacher(teacher) {
        return request({
            //后台接口位置COntroller
            url: `/eduservice/teacher/addEduTeacher`,
            method: 'post',
            //页面中怎么传jason值通过data进行传递
            data: teacher
        })
    },
    getTeacherInfo(id) {
        return request({
            //后台接口位置COntroller
            url: `/eduservice/teacher/${id}`,
            method: 'get',
            //页面中怎么传jason值通过data进行传递
        })
    },
    //修改老师信息
    updateTeacherInfo(teacher) {
        return request({
            //后台接口位置COntroller
            url: `/eduservice/teacher/updateEduTeacher`,
            method: 'post',
            //页面中怎么传jason值通过data进行传递
            data: teacher
        })
    },
    getList(){
        return request({
            //后台接口位置COntroller
            url: `/eduservice/teacher/findAll`,
            method: 'get',
            //页面中怎么传jason值通过data进行传递
        })
    }

}
